In PHP Strpos is the first place to find the string, if there is a return ture or related to the specific number, no return 0 or FALSE, but I want to use it to do a wordpress keyword blacklist anti-spam comments found some problems, below we
Modify theme comments-ajax.php filesIn the comments-ajax.php file under the topic directory, around 60 rows (fields such as $ _ POST ['author'] in the user submitted comment form were just obtained ). Then add the following code to the file:
When we do the message board often need to block keywords Some keywords, below I introduce the use of TXT save to block the keyword, and then based on the user submitted data filtering.
First look at the Strpos function
The Strpos () function
This article mainly introduces how to use the strpos function in PHP to shield sensitive keywords. This article is used to intercept sensitive keys before publishing articles are saved to the database, for more information, see the strict
First look at the Strpos function
The Strpos () function returns the position where the string first appears in another string.
If the string is not found, it returns false.
Grammar
Strpos (string,find,start) parameter descriptionString required.
Now the network information regulation is very strict, especially the shielding keyword. Especially now WEB2.0 times, the content of the website almost all comes from the Netizen publishes, Stationmaster manages can. If you want someone to stop
Now the network information supervision is very strict, especially the blocking keyword. Especially now WEB2.0 era, the content of the website is almost all from the Netizen publishes, the stationmaster manages can. If you want someone to prohibit
Strpos usage
Strpos (String,find,start)
Let's look at a piece of code Strpos:
Ajax get participlePublic Function Get_segment_words () {$title = I (' title ');$content = I (' content ');$Segment = M (' Segment ');$Segment _content = M ('
PHP in a character to find another string, whether there is a strpos, this function usage, often many people use the inverse, the correct usage is Strpos (string,search), the front is the original string, followed by the original string to query the
Question about keyword filtering by strpos function keyword This post was last edited by ron_xin from 2014-10-2514: 31: 16 & lt ;? Phpheader (Content-type: & nbsp; texthtml; & nbsp; charsetutf-8); * & nbsp; use the strpos function in PHP to filter
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.